FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g17a5554.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g17a5554.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=17a5554 OS_GIT_VERSION=4.10.0-202202160023.p0.g17a5554.assembly.stream-17a5554 SOURCE_DATE_EPOCH=1643303450 SOURCE_GIT_COMMIT=17a555447f3a6323d371cf2d5228dbc95918c80e SOURCE_GIT_TAG=17a55544 SOURCE_GIT_URL=https://github.com/openshift/console-operator 
WORKDIR /go/src/github.com/openshift/console-operator
COPY . .
ENV GO_PACKAGE github.com/openshift/console-operator
RUN go build -ldflags "-X $GO_PACKAGE/pkg/version.versionFromGit=$(git describe --long --tags --abbrev=7 --match 'v[0-9]*')" -tags="ocp" -o console ./cmd/console

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g17a5554.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g17a5554.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=17a5554 OS_GIT_VERSION=4.10.0-202202160023.p0.g17a5554.assembly.stream-17a5554 SOURCE_DATE_EPOCH=1643303450 SOURCE_GIT_COMMIT=17a555447f3a6323d371cf2d5228dbc95918c80e SOURCE_GIT_TAG=17a55544 SOURCE_GIT_URL=https://github.com/openshift/console-operator 
RUN useradd console-operator
USER console-operator
COPY --from=builder /go/src/github.com/openshift/console-operator/console /usr/bin/console

# these manifests are necessary for the installer
COPY manifests /manifests/

# out-of-the-box quickstarts
COPY quickstarts/*.yaml /manifests/

# extensions manifests generated from openshift/api types
COPY vendor/github.com/openshift/api/console/v1/*.yaml /manifests/
COPY vendor/github.com/openshift/api/console/v1alpha1/*.yaml /manifests/
COPY vendor/github.com/openshift/api/operator/v1/0000_70_console-operator.crd.yaml /manifests/
COPY vendor/github.com/openshift/api/helm/v1beta1/0000_10-helm-chart-repository.crd.yaml /manifests/



# entrypoint specified in 03-operator.yaml as `console-operator`
# CMD ["/usr/bin/console", "operator", "--kubeconfig", "path/to/config", "--config", "./install/config.yaml", "--v", "4"]
# CMD ["/usr/bin/console", "operator", "--v", "4"]

LABEL \
        io.k8s.display-name="OpenShift console-operator" \
        io.k8s.description="This is a component of OpenShift Container Platform and manages the lifecycle of the web console." \
        io.openshift.tags="openshift" \
        maintainer="Jakub Hadvig <jhadvig@redhat.com>" \
        io.openshift.release.operator="true" \
        name="openshift/ose-console-operator" \
        com.redhat.component="openshift-enterprise-console-operator-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Management Console" \
        release="202202160023.p0.g17a5554.assembly.stream" \
        io.openshift.build.commit.id="17a555447f3a6323d371cf2d5228dbc95918c80e" \
        io.openshift.build.source-location="https://github.com/openshift/console-operator" \
        io.openshift.build.commit.url="https://github.com/openshift/console-operator/commit/17a555447f3a6323d371cf2d5228dbc95918c80e" \
        version="v4.10.0"

